package cn.iocoder.yudao.module.fm.dal.mysql.subgradedefaultdata;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.fm.dal.dataobject.subgradedefaultdata.SubgradeDefaultDataDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.fm.controller.admin.subgradedefaultdata.vo.*;

/**
 * 路基 默认数据 Mapper
 *
 * @author 档案
 */
@Mapper
public interface SubgradeDefaultDataMapper extends BaseMapperX<SubgradeDefaultDataDO> {

    default PageResult<SubgradeDefaultDataDO> selectPage(SubgradeDefaultDataPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SubgradeDefaultDataDO>()
                .eqIfPresent(SubgradeDefaultDataDO::getNo, reqVO.getNo())
                .eqIfPresent(SubgradeDefaultDataDO::getDocumentationStage, reqVO.getDocumentationStage())
                .likeIfPresent(SubgradeDefaultDataDO::getFileName, reqVO.getFileName())
                .eqIfPresent(SubgradeDefaultDataDO::getFileFormat, reqVO.getFileFormat())
                .eqIfPresent(SubgradeDefaultDataDO::getAttachedTestReport, reqVO.getAttachedTestReport())
                .eqIfPresent(SubgradeDefaultDataDO::getRemarks, reqVO.getRemarks())
                .betweenIfPresent(SubgradeDefaultDataDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(SubgradeDefaultDataDO::getId));
    }

    default List<SubgradeDefaultDataDO> selectList(SubgradeDefaultDataExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<SubgradeDefaultDataDO>()
                .eqIfPresent(SubgradeDefaultDataDO::getNo, reqVO.getNo())
                .eqIfPresent(SubgradeDefaultDataDO::getDocumentationStage, reqVO.getDocumentationStage())
                .likeIfPresent(SubgradeDefaultDataDO::getFileName, reqVO.getFileName())
                .eqIfPresent(SubgradeDefaultDataDO::getFileFormat, reqVO.getFileFormat())
                .eqIfPresent(SubgradeDefaultDataDO::getAttachedTestReport, reqVO.getAttachedTestReport())
                .eqIfPresent(SubgradeDefaultDataDO::getRemarks, reqVO.getRemarks())
                .betweenIfPresent(SubgradeDefaultDataDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SubgradeDefaultDataDO::getId));
    }

}
